import excel "../Raw/Yann_Louvel_Reclaim_Finance/Banks coal policies history extracted.xlsx", first clear sheet("Feuil1")
destring Year, ignore("Unknown") replace

*Finding first date policy adopted
drop if Chronology != "First policy" | missing(Year)

// keep BankId Done Year
set scheme s1color
replace Day = 1 if missing(Day)
replace Month = 1 if missing(Month)
gen date = mdy(Month,Day,Year)

preserve
clear
input qdate cumulative
210 0
211 0
212 0
213 0
214 0
215 0
216 0
end
tempfile linestart
save `linestart'
restore

gen qdate = qofd(date)
format qdate %tq
format date %td
collapse (count) BankId, by(qdate)
gen cumulative = sum(BankId)
append using `linestart'
drop if missing(qdate)
format qdate %tqCCYY
sort qdate 

save "../Intermediate/Figure_1_Data", replace 
